﻿#region Imports
using System.ComponentModel;
using CommonUtilities.Extensions;
#endregion

namespace CommonUtilities.Util
{
    public class BaseViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public void RaisePropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (!handler.IsNull())
                handler(this, new PropertyChangedEventArgs(name));
        }

        private bool isBusy;
        /// <summary>
        /// For use in BusyIndicator
        /// </summary>
        [Browsable(false)]
        public bool IsBusy
        {
            get { return isBusy; }
            set { isBusy = value; RaisePropertyChanged("IsBusy"); }
        }
    }
}
